package member.base.model;

import m.common.model.FieldMeta;
import m.common.model.LinkTableMeta;
import m.common.model.Model;
import m.common.model.TableMeta;
import m.common.model.type.FieldType;
import m.common.model.util.ModelQueryList;
import m.system.cache.FlushCache;

@TableMeta(name="b_store_info",description="店铺表")
public class StoreInfo extends Model implements FlushCache {
    @LinkTableMeta(name="business_oid",table= BusinessInfo.class,description="所属商家")
    private BusinessInfo business;
    @LinkTableMeta(name="user_oid",table= UserInfo.class,description="店长")
    private UserInfo user;

    @FieldMeta(name = "color",type = FieldType.STRING,length=20,description = "颜色")
    private String color;
    @FieldMeta(name="name",type= FieldType.STRING,length=50,description="名称")
    private String name;
    @FieldMeta(name="tel",type= FieldType.STRING,length=50,description="电话")
    private String tel;
    @FieldMeta(name="address",type= FieldType.STRING,length=500,description="地址")
    private String address;

    @FieldMeta(name="store_check",type= FieldType.STRING,length=10,defaultValue = "Y",description="店长审核",dictOption = "N:关闭,Y:开启")
    private String storeCheck;
    public final static String StoreCheckYes="Y";
    @FieldMeta(name="account_day",type= FieldType.STRING,length=10,defaultValue = "15",description="账期结束日",dictOption = "05:次月5号,10:次月10号,15:次月15号,20:次月20号,25:次月25号")
    private String accountDay;

    public String getStoreCheck() {
        return storeCheck;
    }

    public void setStoreCheck(String storeCheck) {
        this.storeCheck = storeCheck;
    }

    public String getAccountDay() {
        return accountDay;
    }

    public void setAccountDay(String accountDay) {
        this.accountDay = accountDay;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public UserInfo getUser() {
        return user;
    }

    public void setUser(UserInfo user) {
        this.user = user;
    }

    public BusinessInfo getBusiness() {
        return business;
    }

    public void setBusiness(BusinessInfo business) {
        this.business = business;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public StoreInfo getCacheModel(String oid) throws Exception {
        return ModelQueryList.getModel(StoreInfo.class,oid,"*","user.realName","user.phoneNum");
    }
}
